﻿using System;
using System.Collections.Generic;
using ZilLion.Core.Log;
using ZilLion.Core.TaskManager.Client.SystemMonitor;

//using Log4Wrapper;

namespace ZilLion.Core.TaskManager.Client
{
    /// <summary>
    ///     启动类
    /// </summary>
    public class Bootstrapper
    {
        public static List<BaseMonitor> MonitorsCache = new List<BaseMonitor>();

        public static void Run()
        {
            try
            {
                #region 命令接收开启

                CommandQueueProcessor.Run();

                #endregion

                #region 监控开启

                MonitorsCache.Add(new TaskPerformanceMonitor());
                MonitorsCache.Add(new NodeHeartBeatMonitor());
                MonitorsCache.Add(new TaskRecoverMonitor());
                MonitorsCache.Add(new TaskStopMonitor());

                #endregion
            }
            catch (Exception ex)
            {
                ZilLionLogManager.GetLogger().Error(ex: ex, tags: "节点启动出现致命错误！");
            }
        }
    }
}